<?php
if ($mod == "order"){
	if ($act == "change_status"){
		$status = NULL;
		if (!isset($_GET['status'])) $status=NULL; else $status=$_GET['status'];
		if ($status==NULL) if (!isset($_POST['status'])) $status=NULL; else $status=$_POST['status'];
		if (($status != NULL) && ($parent != NULL)){
			$shop_cartclass->change_order_status($parent, $status);
		}
	}
}
if ($act == "del_order_mas"){
	$del_mas = array();
	if (isset($_GET["ids"])) $del_mas=$_GET["ids"];
	elseif (isset($_POST["ids"])) $del_mas=$_POST["ids"];
	if (count($del_mas) > 0){
		$shop_cartclass->orders_del($del_mas);
	}
}  elseif ($act == "archive_order_mas"){
	$del_mas = array();
	if (isset($_GET["ids"])) $del_mas=$_GET["ids"];
	elseif (isset($_POST["ids"])) $del_mas=$_POST["ids"];
	if (!isset($_GET['status'])) $status=NULL; else $status=$_GET['status'];
	if ($status==NULL) if (!isset($_POST['status'])) $status=NULL; else $status=$_POST['status'];
	if ((count($del_mas) > 0) && ($status != NULL)){
		$shop_cartclass->orders_archive($del_mas, $status);
	}
} elseif ($act == "add_to_stat"){
	$shop_cartclass->add_to_stat($parent);
} elseif ($act == "remove_to_stat"){
	$shop_cartclass->remove_to_stat($parent);
} elseif ($act == "reset_stat"){
	$shop_cartclass->reset_stats();
} elseif ($act == "set_settings"){
	if (!isset($_POST['to_email'])) $to_email=NULL; else $to_email=$_POST['to_email'];
	if (!isset($_POST['to_subject'])) $to_subject=NULL; else $to_subject=$_POST['to_subject'];
	if (!isset($_POST['template'])) $template=NULL; else $template=$_POST['template'];
	if (($to_email != NULL) && ($to_subject != NULL) && ($template != NULL)){
		$shop_cartclass->mod_settings($to_email, $to_subject, $template);
	}
}
?>
